import React from "react";
import routeWithUserSession from "@/components/ApplicationArea/routeWithUserSession";
import EmployeeChangeToolbar from "@/components/employee/EmployeeChangeToolbar";
import routes from "@/services/routes";

class EmployeeChangeNew extends React.Component {

  state = {
    items:[],
       id: "0",
    loading: true,
  };
  componentWillMount() {
    let id;
    if(this.props.id===undefined){
      id=0;
    }else{
      id=this.props.id;
    }
      this.setState({
            id: id,
            loading: false,
      });
  }

  render() {
    if (this.state.loading ) return null;
    return (
      <div className="settings-screen">
        <div className="container">
          <div  style={{width:"400px",height:"40px"}}>
            <div style={{width:"20px",height:"38px", float: "left"}}>
            </div>
              <div style={{width:"50px",height:"38px", float: "left"}}>
              <img src="/static/images/employeechange.png" alt="HR" loading="lazy"/>
            </div>
              <div style={{width:"320px",height:"30px",float:"left"}}>
              <h3 style={{margin:"7px",padding:"0"}}>人员信息</h3>
            </div>
          </div>
            <div className="p-15">
              <EmployeeChangeToolbar  id={this.state.id}/>
            </div>
        </div>
      </div>
    );
  }
}

routes.register(
  "EmployeeChange.New",
  routeWithUserSession({
    path: "/employeechange/new/:id",
    title: "人员信息",
    render: pageProps => <EmployeeChangeNew {...pageProps} />,
  })
);